const path = require('path')
function createPages({ actions }) {
    const data = [
        { slug: 'zhangsan', name: '张三' },
        { slug: 'lisi', name: '李四' }
    ]
    const component = path.resolve('./templates/Somebody.js')
    data.forEach(({ slug, name }) => actions.createPage({
        component,
        path: `/somebody/${slug}`,
        context: { name }
    }))
}
module.exports = {
    createPages
}